import { createBrowserRouter, Navigate } from "react-router-dom";

import Login from '../login/login'
import Onboarding from '../welcomePage/Onboarding'
import Register from '../register/register'
import Email from "../register/component/email";
import NewPassword from "../register/newPassword/createNewPass";
import SuccessPage from '../register/success/successPage'
import Register1 from '../register/registerPage/registerPage'
import YanZheng from '../register/YanZheng/yanZheng'
import NewUser from '../register/newUser/newUser'
import InfoPage from '../register/Info/infoPage'
import MyTell from "../register/myTell/myTell";
import Successful from "../register/successful/successful";
import PhoneYZ from '../login/phone/phoneYZ'
import Phone from '../login/phone/phone'
import Face from '../login/face/face'
import Layout from '../pages/layout.tsx'
import Details from '../pages/detail.tsx'
import Chat from '../pages/chat.tsx'
import Search from '../searchPage/search'
import Result from '../searchPage/result'
import Detail from '../searchPage/detail'
import App from "../App";
import Shou from "../page/Shou";
import SkinAnalysis from "../page/SkinAnalysis";
import AnalysisPage from "../page/AnalysisPage";
import AnalysisResultPage from "../page/AnalysisResultPage";
import List from "../page/List";
import My from "../page/My";
import ResultPage from "../page/ResultPage";


import DetailCar from "../pages/DetailCar";
import DetailShow from "../pages/DetailShow";
import Order from "../pages/Order";
import PaymentSuccess from "../pages/PaymentSuccess";
import Cang from "../pages/Cang";
import Car from "../pages/Car";

const router = createBrowserRouter([
  {
    path: '/',
    element: <Navigate to="/onboarding" replace />
  },
  {
    path: '/app',
    element: <App />,
    children: [
      {
        path: 'shou',
        element: <Shou />
      },
      { path: 'layout', element: <Layout /> },
      {
        path: 'ska',
        element: <SkinAnalysis />
      },
      {
        path: "analy",
        element: <AnalysisPage />
      },
      {
        path: "result",
        element: <AnalysisResultPage />
      },
      {
        path: "history",
        element: <ResultPage />
      },
      {
        path: "cang",
        element: <Cang />
      },
      {
        
      }
    ]
  },
  {
    path: "/face",
    element: <Face />
  },
  {
    path: "/phoneyz",
    element: <PhoneYZ />
  },
  {
    path: "/phone",
    element: <Phone />
  },
  {
    path: "/successful",
    element: <Successful />
  },
  {
    path: "/info",
    element: <InfoPage />
  },
  {
    path: "/mytell",
    element: <MyTell />
  },
  {
    path: "/yanzheng",
    element: <YanZheng />
  },
  {
    path: "/newuser",
    element: <NewUser />
  },
  {
    path: '/onboarding',
    element: <Onboarding />
  },
  {
    path: '/login',
    element: <Login />
  },
  {
    path: "register",
    element: <Register />
  },
  {
    path: "/register1",
    element: <Register1 />
  },
  {
    path: "/email",
    element: <Email />
  },
  {
    path: "/newpassword",
    element: <NewPassword />
  },
  {
    path: "/success",
    element: <SuccessPage />
  },
  {
    path: "/list",
    element: <List />
  },
  {
    path: "/my",
    element: <My />
  },
  {
    path: "/detailCar",
    element: <DetailCar />
  },
  {
    path: "/detailshow",
    element: <DetailShow />
  },
  {
    path: "/order",
    element: <Order />
  },
  {
    path: "/paymentsuccess",
    element: <PaymentSuccess />
  },
  {
    path: "/car",
    element: <Car />
  },
  {
    path:"/search",
    element:<Search/>
  },
    {
    path:"/result",
    element:<Result/>
  },
    {
    path:"/detail",
    element:<Detail/>
  },
  {
    path: '*',
    element: <div>404 Not Found</div>
  },
  { path: '/details', element: <Details /> },
  { path: '/chat', element: <Chat /> },
])
export default router